<script setup>

</script>

<template>
  <div class="listContainer">
    <div class="header">
      <div class="left">
        <slot name="headerLeft"></slot>
      </div>
      <div class="right">
        <slot name="headerRight"></slot>
      </div>
    </div>
    <div class="body">
      <slot name="body"></slot>
    </div>
    <div class="footer">
      <div class="left">
        <slot name="footerLeft"></slot>
      </div>
      <div class="right">
        <slot name="footerRight"></slot>
      </div>
    </div>
  </div>
</template>

<style scoped lang="scss">
.listContainer {
  /* 默认情况下，主轴方向尺寸是靠内容撑开；侧轴默认是拉伸 */
  display: flex;
  flex-direction: column;
  height: 100%;

  .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    height: 50px;

    .left {
      display: flex;
    }
    .left > :deep * {
      width: 100px;
      margin-left: 0;
      margin-right: 10px;
    }
    .left > :deep .input-with-select {
      width: 250px;
    }

    .right {
      display: flex;
    }
    .right > :deep * {
      width: 100px;
      margin-right: 0;
      margin-left: 10px;
    }
  }

  .body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 0;
  }

  .footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    height: 50px;

    .left {
      display: flex;
    }
    .left > :deep * {
      width: 100px;
      margin-left: 0;
      margin-right: 10px;
    }

    .right {
      display: flex;
    }
    .right > :deep * {
      margin-right: 0;
      margin-left: 10px;
    }
  }
}
</style>
